package p3myAnalyzer;

import org.apache.lucene.analysis.Analyzer;
import org.junit.Test;
import p2tokenstream.TokenAttributeUtils;

import java.io.IOException;

public class TestMyAnalyzer {
    /**
     * 自定义停用词分词器
     *

     */
    @Test
    public void test1() throws IOException {
        //参数是哪些停用词
        Analyzer a1=new MyStopAnalyzer(new String[]{"i","my"});
        String str="this is my house,I am com from china，my mail is majian@jd.com,123456";
        //打印出自定义分词器后的信息
        TokenAttributeUtils.displayToken(str,a1);
    }

}
